package redis;

import java.util.Set;

import util.RedisCluster;

public class EnumKeys {
	private static String[] Hosts = new String[] { "10.11.1.52", "10.11.1.54",
		"10.11.1.55", "10.11.1.56", "10.11.1.57", "10.11.1.53" };
	
	private static int port = 6379;

	public static void main(String[] args) {
		RedisCluster cluster = new RedisCluster(Hosts, port);
		
		int sum = 0;
		int keySum = 0;
		for (int i = 0 ; i < Hosts.length; i++) {
			Set<String> keys = cluster.getJedis(i).keys("*");
			System.out.println(keys.size());
			for (String key : keys)
				sum += cluster.getJedis(i).llen(key);
			keySum += keys.size();
			//sum += keys.size();
		}
		System.out.println("total keySum: " + keySum);
		System.out.println("total key: " + sum);
	}
}
